package club.guadazi.wemarket.controller;

import club.guadazi.wemarket.entity.TSystemInfo;
import club.guadazi.wemarket.service.SystemInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * Created by Mariaaron on 16/9/3.
 */
@Controller
@RequestMapping("/")
public class WelcomeController {
    @Resource
    private SystemInfoService systemInfoService;

    @RequestMapping("/")
    public String welcome(Model model) {
        TSystemInfo systemInfo = systemInfoService.get();
        String marketName = systemInfo.getMarketName();
        model.addAttribute("marketName", marketName);
        return "index";
    }
}
